package org.example;


import org.redisson.api.RBucket;
import org.redisson.api.RedissonClient;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 分布式锁aop
 */

@RestController
public class DemoCtrl {
    @GetMapping("a")
    @Cacheable(value = "hi", cacheManager = "redisCacheManager")
    public String hi() {
        return "hi";
    }

    @GetMapping("b")
    @Cacheable(value = "hi2", cacheManager = "caffeineCacheManager")
    public String hi2() {
        return "hi";
    }


}
